﻿<html>
	<head>
		<script language="JavaScript" src="js/jquery.js" type="text/javascript"></script>
		<script language="JavaScript" type="text/javascript">
			$(document).ready(function() {
				$("#testSelect").change(function() {
					var theValue = $(this).val();

					$.getJSON("http://localhost:8500/cfarchitect/com/test.cfc?method=testOptions", {selectType:theValue}, function(result) {
						for (var I=0, L=result.length; I < L; I++) {
							var newOption = '<option value="' + result[I,1] + '">' + result[I,2] + '</option>';

							$("#reselect").append(newOption);
						}
					});
				});
			});
		</script>
	</head>

	<body>
		<select id="testSelect">
			<option value="0">Select One</option>
			<option value="1">A</option>
			<option value="2">B</option>
		</select>

		<select id="reselect"></select>
	</body>
</html>